User Consent
Enterprise can opt for 'User Consent'. All business-initiated conversations via Sinch India WhatsApp Business API should start with an “Opt-In/Opt-Out” by the user. This can be collected through any third-party channel. For example, in an SMS message, In-line with a Web Form, in an Email, or even via a deep-link in print media.
Enterprise can record an opt-in/opt-out by the API call as described below.
Opt-In:
WhatsApp suggests to obtain Opt-Ins from end-user before the business send them any notification and it need to be maintained in the DB which can be referred at any point later. The Opt-In can be collected from user using third party medium or within WhatsApp if a chat window is ongoing. Sinch India has defined an API to share Opt-In information about customers. Business can integrate their system with the API to share the Opt-In as in when acquired from customer (live opt-in services).
Real time Opt-In request flow:
- End customer will provide his Opt-In request through the business Opt-In platform.
- Request will be authenticated.
- Request will get updated in the Sinch India's database in real-time and response will be received by the business.
Note: Business can also share the consent in an offline mode through excel files.
Acknowledgement with Optin: Business can also send a notification as welcome message with each entry in Opt-In table to end user on WhatsApp. This is a configurable feature which can be enabled on request and template need to be whitelisted in advance. We support sending static text/media message as acknowledgement with optin entry.
Request URL:
- Production / Live: https://optin.aclwhatsapp.com/api/v1/optin/bulk
- UAT: https://pushuat.aclwhatsapp.com/optin/api/v1/wa/optin/bulk
The request will be authorized using the token provided in the 'Header', generated as described in the Before You Start section.
JSON object parameters:
Name | Description | Json Type | Default | Constraints | Required |
---|---|---|---|---|---|
msisdnList | List of MSISDNs | Array of string | N/A | 10,000 elements | Yes |
Sample:
{
"msisdnList": [
"91XXXXXXXXXX",
"91XXXXXXXXXX"
]
}
Request type: POST
Responses:
200 OK
Opt-In completed successfully.
There was an error with your request. The body is a JSON object described above in HTTP Errors.
401 UnauthorizedThere was an authentication error with your request. Either you're using incorrect credentials or you're attempting to authenticate in a region where your bot doesn't reside. The body is a JSON object described above in HTTP Errors.
Opt-Out:
Request URL:
- Production / Live: https://optin.aclwhatsapp.com/api/v1/optout/bulk
- UAT: https://pushuat.aclwhatsapp.com/optin/api/v1/wa/optout/bulk
Request type: POST
The request will be authorized using the token provided in the 'Header', generated as described in the Before You Start section.
JSON object parameters:
Name | Description | Json Type | Default | Constraints | Required |
---|---|---|---|---|---|
msisdnList | List of MSISDNs | Array of string | N/A | 10,000 elements | Yes |
Sample:
{
"msisdnList": [
"91XXXXXXXXXX",
"91XXXXXXXXXX"
]
}
Responses:
200 OK
Opt-out completed successfully.
There was an error with your request. The body is a JSON object described above in HTTP Errors.
401 UnauthorizedThere was an authentication error with your request. Either you're using incorrect credentials or you're attempting to authenticate in a region where your bot doesn't reside. The body is a JSON object described above in HTTP Errors.
Fetch User Consent Data:
API Endpoint:
- Production / Live: https://smartta.aclwhatsapp.com/optindata/v1/{fromDate}/{toDate}
- UAT: https://smarttauat.aclwhatsapp.com/optindata/v1/{fromDate}/{toDate}
Request type: GET
The request will be authorized using the token provided in the 'Header' generated as described in the Before You Start section.
curl --location '
https://smartta.aclwhatsapp.com/optindata/v1/2024-05-29/2024-05-31/'\
--header 'Authorization: Bearer XXXXXXX' \
--data ''
Header values:
Name | Value |
---|---|
Authorization | Bearer token |
Parameters:
Name | Description | Restriction | Format | Value |
---|---|---|---|---|
fromDate | The date from which opt-in data need to be fetched. | Duration between fromDate and toDate should not be more than 10 days. | YYYY-MM-DD | 2023-07-04 |
toDate | The date upto which opt-in data need to be fetched. | Optional field. | YYYY-MM-DD | 2023-07-04 |
Responses Payload:
[
{
"msisdn": "9188XXXXXXXX",
"createdOn": "2023-07-04T10:04:54.582Z",
"optInStatus": 1,
"source": "Keyword"
},
{
"msisdn": "9188XXXXXXXX",
"createdOn": "2023-07-04T10:54:22.427Z",
"optInStatus": 0,
"source": "Keyword"
}
]
Key | Description |
---|---|
msisdn | The MSISDN of the User. |
createdOn | The date record opted in or opted out. |
optInStatus | optInStatus - 1 denotes to 'Consent Given', 0 denotes to 'Consent Revoked'. |
source | Mechanism through which user opted in or opted out. Values - Keyword, API. |
The response of the API will be synchronous.